package com.qf.zyh.web.serCont;

import cn.dsna.util.images.ValidateCode;
import com.qf.zyh.common.Const;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/code")
public class CodeCnot extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        ValidateCode vc = new ValidateCode(160,30,3,10);
        String code = vc.getCode();
        req.getSession().setAttribute(Const.VALI_DATA, code);
        vc.write(resp.getOutputStream());
    }
}
